import { createStore } from 'vuex'
// import {getLyric} from '@/axios/api/home.js'
import {getLogin} from '@/axios/api/home.js'

export default createStore({
  state: {
    // musicURL:JSON.parse(sessionStorage.getItem("itemDetails")) || {}
    musicURL:[{
      al: {
        id: 1446137141,
        name: "精神领袖",
        pic: 109951164966568500,
        picUrl: "https://p1.music.126.net/2f6UgY8Jc0Dy6jufMdIZeQ==/109951164966568495.jpg",
        pic_str: "109951164966568495"
      },
      ar:[
        {
          name:'初晨'
        }
      ],
      id: 1446137141,
      name:'精神领袖',
    }],
    playIndex:0,
    playOrPause:true,
    id: 1446137141,
    lycShow:false,
    isLogin:false
  },
  getters: {
  },
  mutations: {

    MUSICLIST(state,musicURL){
      state.musicURL=musicURL
    },
    UPDATASTATE(state,value){
      state.playOrPause = value
    },
    UPDATAINDEX(state,value){
      state.playIndex = value
    },
    UPDATAINDEXS(state,value){
      state.playIndex = value
      // console.log(value)
    },
    ADDSearch(state,value){
       state.musicURL=value
    }
  },
  actions: {
    //  async getLogin(context,value){
    //    let res = await getLogin(value)
    //    console.log(res)
      //  console.log(value2)

    //  }
  },
  modules: {
  }
})
